home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Updates / Librarys / Xvs / Developer / autodoc / xvs.doc
Text File  |  1999-04-26  |  13KB  |  470 lines

  1. TABLE OF CONTENTS
  2.  
  3. xvs.library/xvsAllocObject
  4. xvs.library/xvsCheckBootblock
  5. xvs.library/xvsCheckFile
  6. xvs.library/xvsCheckSector
  7. xvs.library/xvsCreateVirusList
  8. xvs.library/xvsFreeObject
  9. xvs.library/xvsFreeVirusList
  10. xvs.library/xvsInstallBootblock
  11. xvs.library/xvsObjectType
  12. xvs.library/xvsRepairFile
  13. xvs.library/xvsRepairSector
  14. xvs.library/xvsSelfTest
  15. xvs.library/xvsSumBootblock
  16. xvs.library/xvsSurveyMemory
  17.  
  18. xvs.library/xvsAllocObject                         xvs.library/xvsAllocObject
  19.  
  20.    NAME
  21.     xvsAllocObject -- Allocate memory for specified object.
  22.  
  23.    SYNOPSIS
  24.     object = xvsAllocObject(objecttype)
  25.       D0          -48           D0
  26.  
  27.     APTR xvsAllocObject(ULONG);
  28.  
  29.    FUNCTION
  30.     Allocates a memory block and required resources for the specified
  31.     object. Never do this in any other way for compatibility with
  32.     library updates.
  33.  
  34.     Objecttype can be one of these:
  35.     XVSOBJ_BOOTINFO    - allocate a xvsBootInfo structure.
  36.     XVSOBJ_FILEINFO    - allocate a xvsFileInfo structure.
  37.     XVSOBJ_MEMORYINFO  - allocate a xvsMemoryInfo structure.
  38.     XVSOBJ_SECTORINFO  - allocate a xvsSectorInfo structure.
  39.  
  40.    INPUTS
  41.     objecttype - One of the XVSOBJ_#? values.
  42.  
  43.    RESULT
  44.     object - Pointer to the object or NULL if there occured an error.
  45.  
  46.    SEE ALSO
  47.     xvsFreeObject()
  48.  
  49. xvs.library/xvsCheckBootblock                   xvs.library/xvsCheckBootblock
  50.  
  51.    NAME
  52.     xvsCheckBootblock -- Check bootblock contents for viruses.
  53.  
  54.    SYNOPSIS
  55.     result = xvsCheckBootblock(bootinfo)
  56.       D0            -66           A0
  57.  
  58.     ULONG xvsCheckBootblock(struct xvsBootInfo *);
  59.  
  60.    FUNCTION
  61.     Checks if a bootblock contains viruses and informs about the
  62.     dostype, checksum and type of the bootblock.
  63.  
  64.     xvsbi_Bootblock must be initialized with a pointer to a 1024 bytes
  65.     bootblock.
  66.  
  67.     The bootblock will be first checked for the dostype. If it's not
  68.     a DOS bootblock, you'll receive XVSBT_NOTDOS as a result.
  69.     Otherwise xvsbi_DosType will receive the type of filesystem the
  70.     disk is using (eg. DOS/0 -> xvsbi_DosType = 0).
  71.     The xvsbi_ChkSumFlag field will be TRUE if the bootblock checksum
  72.     is correct (ie. bootable), otherwise it's FALSE.
  73.  
  74.     Now the bootblock will be checked for standard bootblocks and
  75.     viruses. You'll receive XVSBT_STANDARD13, XVSBT_STANDARD20 or
  76.     XVSBT_VIRUS in that case.
  77.  
  78.     If all the tests were negative, XVSBT_UNKNOWN is returned. Note
  79.     that XVSBT_UNINSTALLED will never be returned by this function,
  80.     it is only used by xvsInstallBootblock(). You can consider an
  81.     unknown bootblock with xvsbi_ChkSumFlag set to FALSE as uninstalled.
  82.  
  83.     In all cases, you'll receive the result in xvsbi_BootType too
  84.     and a describing ascii text in xvsbi_Name.
  85.  
  86.    INPUTS
  87.     bootinfo - Pointer to initialized xvsBootInfo structure.
  88.  
  89.    RESULT
  90.     result   - One of the XVSBT_#? values.
  91.  
  92. xvs.library/xvsCheckFile                             xvs.library/xvsCheckFile
  93.  
  94.    NAME
  95.     xvsCheckFile -- Check file contents for viruses.
  96.  
  97.    SYNOPSIS
  98.     result = xvsCheckFile(fileinfo)
  99.       D0         -96         A0
  100.  
  101.     ULONG xvsCheckFile(struct xvsFileInfo *);
  102.  
  103.    FUNCTION
  104.     Checks any file (executable/data) for virus infection and informs
  105.     about the type of file.
  106.  
  107.     IMPORTANT: The file must be in decrunched state, linked files must
  108.     be unlinked first, otherwise this function cannot find all built-in
  109.     viruses. Use xfdmaster.library for this purpose, you'll find it in
  110.     the Aminet too.
  111.  
  112.     xvsfi_File must be supplied with a pointer to the buffer holding
  113.     the file, xvsfi_FileLen must receive the length of the file.
  114.  
  115.     The file will be first checked if it's executable. If not, it's
  116.     a data file and will be scanned for data viruses (eg. scripts,
  117.     bootblocks). If nothing is found, the result is XVSFT_DATAFILE,
  118.     otherwise you'll receive XVSFT_DATAVIRUS. Such files can only be
  119.     deleted.
  120.  
  121.     Executable files are tested for link- and fileviruses. The result
  122.     for linkviruses is XVSFT_LINKVIRUS, you can repair these files with
  123.     a call to xvsRepairFile(). Fileviruses return XVSFT_FILEVIRUS and
  124.     the file can only be deleted completely.
  125.  
  126.     In all cases, you'll receive the result in xvsfi_FileType too
  127.     and a describing ascii text in xvsfi_Name.
  128.  
  129.     After calling this function, always test xvsfi_ModifiedFlag. If
  130.     this is TRUE, the recognition code modified your file buffer and
  131.     it's no longer safe to write it back to disk, execute it etc.
  132.     Some viruses require a lot of decrypt work for recognition and
  133.     it's not possible to detect them without, that's why I had to
  134.     add this flag.
  135.  
  136.    INPUTS
  137.     fileinfo - Pointer to initialized xvsFileInfo structure.
  138.  
  139.    RESULT
  140.     result   - One of the XVSFT_#? values.
  141.  
  142.    SEE ALSO
  143.     xvsRepairFile()
  144.  
  145. xvs.library/xvsCheckSector                         xvs.library/xvsCheckSector
  146.  
  147.    NAME
  148.     xvsCheckSector -- Check disk sector contents for virus modifications.
  149.  
  150.    SYNOPSIS
  151.     result = xvsCheckSector(sectorinfo)
  152.       D0          -84           A0
  153.  
  154.     ULONG xvsCheckSector(struct xvsSectorInfo *);
  155.  
  156.    FUNCTION
  157.     Checks if a sector has been modified by viruses.
  158.  
  159.     xvssi_Sector must be initialized with a pointer to a 512 bytes
  160.     disk sector, xvssi_Key with the sector number it has on disk.
  161.  
  162.     The sector will be checked for damages or changes done by viruses.
  163.     If anything is found, XVSST_DESTROYED or XVSST_INFECTED will be
  164.     returned, otherwise you'll receive XVSST_UNKNOWN.
  165.  
  166.     In all cases, you'll receive the result in xvssi_SectorType too
  167.     and a describing ascii text in xvssi_Name.
  168.  
  169.    INPUTS
  170.     sectorinfo - Pointer to initialized xvsSectorInfo structure.
  171.  
  172.    RESULT
  173.     result     - One of the XVSST_#? values.
  174.  
  175.    SEE ALSO
  176.     xvsRepairSector()
  177.  
  178. xvs.library/xvsCreateVirusList                 xvs.library/xvsCreateVirusList
  179.  
  180.    NAME
  181.     xvsCreateVirusList -- Allocate and initialize xvsVirusList structure.
  182.  
  183.    SYNOPSIS
  184.     viruslist = xvsCreateVirusList(listtype)
  185.        D0              -36            D0
  186.  
  187.     struct xvsVirusList *xvsCreateVirusList(ULONG);
  188.  
  189.    FUNCTION
  190.     Allocates memory for a xvsVirusList structure and initializes it
  191.     with nodes of the required type.
  192.  
  193.     Listtype can be one of these:
  194.     XVSLIST_BOOTVIRUSES  - create list of bootblock viruses.
  195.     XVSLIST_FILEVIRUSES  - create list of file viruses.
  196.     XVSLIST_LINKVIRUSES  - create list of link viruses.
  197.  
  198.     The list should be used for information purposes only, eg. for a
  199.     listview gadget of gadtools.library.
  200.     xvsVirusList->LH_TYPE holds the XVSLIST_#? value,
  201.     xvsVirusList->xvsvl_Count holds the amount of nodes.
  202.     The nodes themselves hold a pointer to the virus name in the
  203.     LN_NAME field.
  204.  
  205.    INPUTS
  206.     listtype - One of the XVSLIST_#? values.
  207.  
  208.    RESULT
  209.     viruslist - Pointer to xvsVirusList or NULL if not enough memory.
  210.  
  211.    SEE ALSO
  212.     xvsFreeVirusList()
  213.  
  214. xvs.library/xvsFreeObject                           xvs.library/xvsFreeObject
  215.  
  216.    NAME
  217.     xvsFreeObject -- Release memory of object.
  218.  
  219.    SYNOPSIS
  220.     xvsFreeObject(object)
  221.          -54        A1
  222.  
  223.     void xvsFreeObject(APTR);
  224.  
  225.    FUNCTION
  226.     Deallocates the memory and releases the resources reserved via
  227.     xvsAllocObject().
  228.  
  229.    INPUTS
  230.     object - Pointer to object.
  231.  
  232.    RESULT
  233.     None.
  234.  
  235.    SEE ALSO
  236.     xvsAllocObject()
  237.  
  238. xvs.library/xvsFreeVirusList                     xvs.library/xvsFreeVirusList
  239.  
  240.    NAME
  241.     xvsFreeVirusList -- Release memory of xvsVirusList structure.
  242.  
  243.    SYNOPSIS
  244.     xvsFreeVirusList(viruslist)
  245.           -42            A1
  246.  
  247.     void xvsFreeVirusList(struct xvsVirusList *);
  248.  
  249.    FUNCTION
  250.     Deallocates the memory of a xvsVirusList structure that has been
  251.     returned as result by xvsCreateVirusList().
  252.  
  253.    INPUTS
  254.     viruslist - Pointer to a xvsVirusList structure.
  255.  
  256.    RESULT
  257.     None.
  258.  
  259.    SEE ALSO
  260.     xvsCreateVirusList()
  261.  
  262. xvs.library/xvsInstallBootblock               xvs.library/xvsInstallBootblock
  263.  
  264.    NAME
  265.     xvsInstallBootblock -- Install some standard bootblocks to buffer.
  266.  
  267.    SYNOPSIS
  268.     xvsInstallBootblock(bootblock, boottype, dostype)
  269.             -72            A0         D0        D1
  270.  
  271.     void xvsInstallBootblock(APTR, ULONG, ULONG);
  272.  
  273.    FUNCTION
  274.     Installs desired bootblock data to the buffer. The checksum will
  275.     be corrected automatically except for XVSBT_UNINSTALLED bootblocks.
  276.  
  277.     Boottype can be one of these:
  278.     XVSBT_UNINSTALLED - creates uninstalled (non-bootable) bootblock.
  279.     XVSBT_STANDARD13  - creates standard bootblock (Kickstart 1.3).
  280.     XVSBT_STANDARD20  - creates standard bootblock (Kickstart 2.0).
  281.  
  282.     Dostype specifies the file